package com.prik.command.commands;

import com.prik.command.Command;
import com.prik.command.products.Stereo;

/**
 * @description: 音响打开命令
 * @author: Xu Shiwei
 * @create: 2019-08-08
 **/
public class StereoOnWithCdCommand implements Command {

    Stereo stereo;

    public StereoOnWithCdCommand(Stereo stereo) {
        this.stereo = stereo;
    }

    @Override
    public void execute() {
        stereo.on();
        stereo.playCD();
        stereo.setVolume(50);
    }

    @Override
    public void undo() {
        stereo.off();
    }
}